#include "vector2.h"

Vector2::Vector2() : x(0.0f), y(0.0f)
{

}

Vector2::Vector2(float fX, float fY) : x(fX), y(fY)
{

}

Vector2::Vector2(Vector2 *vec) : x(vec->x), y(vec->y)
{

}

float Vector2::operator[](int &param)
{
	if(param == 0) return x;
	else if(param == 1) return y;
	return 0.0f;
}

Vector2* Vector2::operator+=(Vector2 &param)
{
	x += param.x;
	y += param.y;

	return this;
}

Vector2* Vector2::operator+=(float param[2])
{
	x += param[0];
	y += param[1];

	return this;
}

Vector2* Vector2::operator-=(Vector2 &param)
{
	x -= param.x;
	y -= param.y;

	return this;
}

Vector2* Vector2::operator-=(float param[2])
{
	x -= param[0];
	y -= param[1];

	return this;
}

